package com.travel.common.util;

import java.io.Serializable;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public abstract class AbstractBean implements ApplicationContextAware, Serializable {
	private static final long serialVersionUID = 7555719288438179798L;
	protected ApplicationContext applicationContext;

	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}

	public ApplicationContext getApplicationContext() {
		return this.applicationContext;
	}

	public Object getBean(String beanName) {
		return this.applicationContext.getBean(beanName);
	}
}